<h1>Listes des compétitions</h1>

<% for competition in @competitions %>
<table>
	<tr>
		<td>
			<h2><%= link_to competition.nom, :action => 'show', :id => competition %></h2>
			Dates: <%= competition.dateDebut %> à <%= competition.dateFin %> <br/>
		</td>
	</tr>
	<tr>
		<td valign=top><%= competition.description %></td>
	</tr>
	<tr>
	<td> Action :
		<%= link_to 'Afficher', :action => 'show', :id => competition %>
		<% if !session[:admin].nil? %>
	   	<%= link_to 'Modifier', :action => 'edit', :id => competition %>
	   	<%= link_to 'Effacer', { :action => 'destroy', :id => competition },
			:confirm => ("Etes vous sur de vouloir effacer '" + competition.nom + "'?"),
			:method => :post %>
		<% end %>
	</td>	
   </tr>
	<tr><tr height='20px'></tr></tr>
</table>
<% end %>

<br/>

<%= link_to 'Créer une nouvelle compétition', :action => 'new' %>



